﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserAccessList.aspx.cs"
    Inherits="BOH.DataManagement.UserAccessList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link href="../style/css.css" type="text/css" rel="Stylesheet" />

    <script src="../js/jquery-1.3.2.js" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>

    <link href="../style/jquery.msgbox.css" type="text/css" rel="Stylesheet" />

    <script src="../js/jquery.msgbox.min.js" type="text/javascript"></script>

    <script src="../js/jquery.dragndrop.min.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript" src="../js/popup_layer.js"></script>

    <script>
        function ShowDialog(obj) {
            var strDiv = '<%= DivHTMLRights %>';
            $.msgbox({
                closeIcon: 'Close',
                height: 500,
                width: 350,
                content: strDiv 
            });
        }

        function SelectRight(str, SetObj, sender) {
            var rightType = $("#" + str).val();
            var rightName = sender;
            $("#" + SetObj).val(sender);
            $("#" + SetObj + "_hiddenRight").val(rightType);
            
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divNavigation">
        当前位置:<a href="OverView.aspx" target="frameControl">后台数据管理</a> >> 用户权限列表
    </div>
    <div id="bodyDiv">
        <div id="divSearch">
            用户名称:<asp:TextBox ID="txtUserName" Width="120px" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            权限类型:
            <input type="button" id="RightSelect" value="选择权限" onclick="ShowDialog(this.id)"/>
            <asp:HiddenField ID="RightSelect_hiddenRight" runat="server" />
            &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="butSearch" runat="server" Text="查 询" Width="100px" OnClick="butSearch_Click" />
        </div>
    </div>
    <div id="divGrid">
        <asp:HiddenField ID="hiddenSelected" runat="server" />
        <asp:GridView ID="AccessViewList" runat="server" AutoGenerateColumns="False" Width="98%"
            CssClass="Grid" AllowPaging="True" PageSize="15" DataKeyNames="RightID,UserID"
            OnRowDataBound="AccessViewList_RowDataBound" OnRowEditing="AccessViewList_RowEditing"
            OnRowCancelingEdit="AccessViewList_RowCancelingEdit" OnRowUpdating="AccessViewList_RowUpdating">
            <PagerSettings Mode="NumericFirstLast" />
            <RowStyle Height="20px" />
            <Columns>
                <asp:TemplateField HeaderText="用户名称" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:HiddenField ID="hidSURID" runat="server" Value='<%#Eval("SURID") %>' />
                        <a href="UserAdd.aspx?type=edit&ID=<%#Eval("UserID") %>" target="frameControl">
                            <%#Eval("UserName") %></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="用户权限" HeaderStyle-Width="220px" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="labRightTpye" Text='<%#Eval("RightName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtAccess" runat="server" ReadOnly="true" Style="cursor: hand" onclick="ShowDialog(this.id)"
                            Text='<%#Eval("RightName") %>'></asp:TextBox>
                        <asp:HiddenField ID="txtAccess_hiddenRight" runat="server" Value='<%#Eval("RightType") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="labStatus" Text='<%#getStatus(Eval("RightStatus").ToString()) %>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField HeaderStyle-HorizontalAlign="Left" HeaderText="修改" HeaderStyle-Width="100px"
                    ButtonType="Link" EditText="修改" ShowCancelButton="true" ShowEditButton="true"
                    CancelText="取消" UpdateText="保存" />
            </Columns>
            <AlternatingRowStyle CssClass="ARow" />
        </asp:GridView>
        <div id="divPager">
            <asp:Label ID="labNoRecord" Visible="false" runat="server" Text="查询结果为空!"></asp:Label>
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="15" AlwaysShow="True"
                OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Left" CustomInfoSectionWidth="35%"
                ShowPageIndexBox="always" PageIndexBoxType="DropDownList" CustomInfoHTML="第<font color='red'><b>%currentPageIndex%</b></font>页，共%PageCount%页，每页显示%PageSize%条记录">
            </webdiyer:AspNetPager>
        </div>
    </div>
    </form>
</body>
</html>
